<%@ page language="java"
	import="com.sql.*,com.database.*"
	pageEncoding="gb2312"%>
<%
	String CardType = request.getParameter("CardType");
			CardType=new CqmsBranch().getZhongWen(CardType);
		
	String vipid  = request.getParameter("vipid");
	String CardLength=request.getParameter("CardLength");
	String CardVerifyStart=request.getParameter("CardVerifyStart");
	String CardVerifyEnd=request.getParameter("CardVerifyEnd");
	String CardVerifyData=request.getParameter("CardVerifyData");
	String sYGIDArray[] = request.getParameterValues("YGID");
		String LMID=request.getParameter("LMID");
	String EnableSms=request.getParameter("EnableSms");
	
	
	String roleList="";
	if (sYGIDArray !=null ){ 
		int len = java.lang.reflect.Array.getLength(sYGIDArray);
         for(int i=0;i<len;i++){
               		roleList = roleList + sYGIDArray[i] + "|";
               }
		}
		else{
		response.sendRedirect("Vipdjsetadd.jsp");
		
		}
	System.out.println("-roleList--"+roleList+"   CardType="+CardType+"  vipid="+vipid+"  CardLength="+CardLength);
	
	System.out.println("CardVerifyStart=="+CardVerifyStart+"  CardVerifyEnd=="+CardVerifyEnd+"  CardVerifyData="+CardVerifyData+"-----");
	
	
	DataBase db1 = new DataBase();
	String sql = "Insert into CQMS_CardBusiness(VipID,CardType,WinTypeID,EnableSms)values('"+vipid+"','"+CardType+"','"+roleList+"','"+EnableSms+"')";
	db1.executeUpdate(sql);
	db1.closeStmt();
	db1.closeConn();
	
		
	DataBase db2 = new DataBase();
	String sql2 = "Insert into CQMS_Vipcard(VipID,CardLength,CardVerifyStart,CardVerifyEnd,CardVerifyData)"+
								"values('"+vipid+"','"+CardLength+"','"+CardVerifyStart+"','"+CardVerifyEnd+"','"+CardVerifyData+"')";
	db2.executeUpdate(sql2);
	db2.closeStmt();
	db2.closeConn();
	response.sendRedirect("Vipdjset.jsp");

%>
